package com.itlaoqi.eurekaclient.config;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

//http://book-service/bsn?sn=xxx
@FeignClient(name="book"   , fallback = BookFeign.MemberClientFallBack.class)
public interface BookFeign {

    @GetMapping("/books")
    public String   books();


    @Component
    static class MemberClientFallBack implements BookFeign{

        @Override
        public String books() {

            return "查询出错";
        }
    }

}
